package top.pmwly.oauth2.controller;

import org.apache.tomcat.util.http.parser.Authorization;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.pmwly.oauth2.pojo.User;

/**
 * @author Herther
 * @version 1.0.0
 * @ClassName UserController.java
 * @Description 用户控制
 * @createTime 2021年08月21日 17:52:00
 */
@RestController
@RequestMapping("/user")
public class UserController {

    /**
     * 获取当前对象
     * @param authentication
     * @return
     */
    @RequestMapping("/getDetails")
    public Object getDetails(Authentication authentication){
        return authentication.getPrincipal();
    }


}
